//package com.bnzjy.srb.sms.receiver;
//
//import com.bnzjy.srb.base.pojo.dto.SmsDto;
//import com.bnzjy.srb.rabbitutil.constant.MQConst;
//import com.bnzjy.srb.sms.component.SmsComponent;
//import com.bnzjy.srb.sms.util.SmsProperties;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.amqp.rabbit.annotation.Exchange;
//import org.springframework.amqp.rabbit.annotation.Queue;
//import org.springframework.amqp.rabbit.annotation.QueueBinding;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.Resource;
//import java.util.HashMap;
//import java.util.Map;
//
//@Component
//@Slf4j
//public class SmsReceiver {
//
//    @Resource
//    SmsComponent smsComponent;
//
//    @RabbitListener(bindings = @QueueBinding(
//        // 队列的名字
//        value = @Queue(value = MQConst.QUEUE_SMS_ITEM, durable = "true"),
//        // 交换机
//        exchange = @Exchange(value = MQConst.EXCHANGE_TOPIC_SMS),
//        // 路由
//        key = {MQConst.ROUTING_SMS_ITEM}
//    ))
//
//    public void send(SmsDto smsDto) {
//        log.info("SmsReceiver 消息监听");
//
//        Map<String,Object> param = new HashMap<>();
//        param.put("code", smsDto.getMessage());
//
//        smsComponent.sendSmsCode(smsDto.getMobile(), smsComponent.getTemplate_id(), param);
//    }
//}
